/**
 * Created by GanJc on 2015/12/27.
 */
'use strict';

var process = require("process");

// current JavaScript file:
console.log('current js file: ' + __filename);

// current JavaScript file dir:
console.log('current js dir: ' + __dirname);

process.name = 'Sample Nodejs';

// process.argv 存储了命令行参数:
console.log('arguments: ' + JSON.stringify(process.argv));

// process.cwd() 返回当前工作目录:
console.log('cwd: ' + process.cwd());

process.nextTick(function () {
    console.log('nextTick callback!');
});
console.log('nextTick was set!');
process.on('exit', function (code) {
    console.log('about to exit with code: ' + code);
});

if (typeof(window) === 'undefined') {
    console.log('node.js');
} else {
    console.log('browser');
}